package org.moore.controller;

import org.moore.model.Map;
import org.moore.utils.BlockUtils;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

// 游戏提示按钮监听类
public class TipButtonListener implements MouseListener {
    @Override
    public void mouseClicked(MouseEvent e) {
        // 调用提示方法
        BlockUtils.blockTip();
        // 如果没得提示了，就是死图，重新生成地图
        if (!BlockUtils.blockTip()) {
            // 创建一个新的字体对象
            Font newFont = new Font("宋体", Font.PLAIN, 18);
            // 设置所有的OptionPane字体
            UIManager.put("OptionPane.messageFont", newFont);
            UIManager.put("OptionPane.buttonFont", newFont);
            JOptionPane.showMessageDialog(null, "没有可以消除的消除物了");
            new Map(9,9,Map.getLevel());
        }
    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
}
